package com.ruoyi.system.service.impl;

import java.util.Date;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.MedicineReminderMapper;
import com.ruoyi.system.domain.MedicineReminder;
import com.ruoyi.system.service.IMedicineReminderService;

/**
 * 吃药提醒Service业务层处理
 * 
 * @author shan
 * @date 2025-04-13
 */
@Service
public class MedicineReminderServiceImpl implements IMedicineReminderService 
{
    @Autowired
    private MedicineReminderMapper medicineReminderMapper;

    /**
     * 查询吃药提醒
     * 
     * @param reminderId 吃药提醒主键
     * @return 吃药提醒
     */
    @Override
    public MedicineReminder selectMedicineReminderByReminderId(Long reminderId)
    {
        return medicineReminderMapper.selectMedicineReminderByReminderId(reminderId);
    }

    /**
     * 查询吃药提醒列表
     * 
     * @param medicineReminder 吃药提醒
     * @return 吃药提醒
     */
    @Override
    public List<MedicineReminder> selectMedicineReminderList(MedicineReminder medicineReminder)
    {
        return medicineReminderMapper.selectMedicineReminderList(medicineReminder);
    }

    /**
     * 新增吃药提醒
     * 
     * @param medicineReminder 吃药提醒
     * @return 结果
     */
    @Override
    public int insertMedicineReminder(MedicineReminder medicineReminder)
    {
        medicineReminder.setCreateTime(new Date());
        medicineReminder.setUpdateTime(new Date());
        return medicineReminderMapper.insertMedicineReminder(medicineReminder);
    }

    /**
     * 修改吃药提醒
     * 
     * @param medicineReminder 吃药提醒
     * @return 结果
     */
    @Override
    public int updateMedicineReminder(MedicineReminder medicineReminder)
    {
        medicineReminder.setUpdateTime(new Date());
        return medicineReminderMapper.updateMedicineReminder(medicineReminder);
    }

    /**
     * 批量删除吃药提醒
     * 
     * @param reminderIds 需要删除的吃药提醒主键
     * @return 结果
     */
    @Override
    public int deleteMedicineReminderByReminderIds(Long[] reminderIds)
    {
        return medicineReminderMapper.deleteMedicineReminderByReminderIds(reminderIds);
    }

    /**
     * 删除吃药提醒信息
     * 
     * @param reminderId 吃药提醒主键
     * @return 结果
     */
    @Override
    public int deleteMedicineReminderByReminderId(Long reminderId)
    {
        return medicineReminderMapper.deleteMedicineReminderByReminderId(reminderId);
    }
}
